package middleware

import (
	"fmt"
	"github.com/gin-gonic/gin"
)

type Cors struct {
	//Dependent services
}

func NewCors() *Cors {
	return &Cors{
		//Inject services
	}
}

func (c Cors) Process(app *gin.Context) {
	fmt.Print("6666")
	id := app.Query("id")
	if id == "5" {
		fmt.Print("拦截请求")
		app.JSON(200, gin.H{"hello word": id})
		app.Abort()
	}
	fmt.Print("执行中间件")
	//return "hello"
}
